# Once done, this will define
#
#  CURL_INCLUDE_DIR - the CURL include directory
#  CURL_LIBRARY_DIR - the CURL library directory
#  CURL_LIBS - link these to use CURL
#
#  ......

MACRO(LOAD_CURL os arch)
    #MESSAGE(INFO "--------------------------------")
    #MESSAGE(STATUS "3RDPARTY_DIR: ${3RDPARTY_DIR}")
    #FIND_FILE(SPDLOG_INCLUDE_DIR include ${3RDPARTY_DIR} NO_DEFAULT_PATH)
    #FIND_FILE(SPDLOG_LIBRARY_DIR lib ${3RDPARTY_DIR} NO_DEFAULT_PATH)
    IF(DEFINED SERVER_3RDPARTY_PATH)
        SET(3RDPARTY_DIR ${SERVER_3RDPARTY_PATH}/curl-7_77_0)
        SET(CURL_INCLUDE_DIR ${3RDPARTY_DIR}/include)
        SET(CURL_LIBRARY_DIR ${3RDPARTY_DIR}/lib)
    ELSE()
        SET(3RDPARTY_DIR ${PROJECT_SOURCE_DIR}/3rdparty/target)
        SET(CURL_INCLUDE_DIR ${3RDPARTY_DIR}/include/curl)
        SET(CURL_LIBRARY_DIR ${3RDPARTY_DIR}/lib/${${os}}_${${arch}}/curl)
    ENDIF()

    IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
        SET(CURL_LIBS curl)
    ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
        SET(CURL_LIBS curl)
    ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
ENDMACRO()
